#include<iostream>
#include<cstdio>
using namespace std;
int a[1001];
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	cout<<"1 5 8 11 13 14 15 17"<<endl;
	cout<<"2 6 9 12 16 18"<<endl;
	cout<<"3 7 10 19"<<endl;
	cout<<"4 20"<<endl; 
}
